from typing import *
from leetcode.editor.common.node import *


# leetcode submit region begin(Prohibit modification and deletion)
class Solution:
    def maxVowels(self, s: str, k: int) -> int:
        need = ['a','e','i','o','u']
        left,right = 0,0
        maxa = 0
        windows = 0
        while right<len(s):
            r = s[right]
            if r in need:
                windows +=1
                maxa = max(windows,maxa)
                if maxa == k:
                    return k
            right +=1
            if right-left>=k:
                l = s[left]
                if l in need:
                    windows -=1
                left +=1
        return maxa
        
# leetcode submit region end(Prohibit modification and deletion)


if __name__ == '__main__':
    solution = Solution()
    print(solution.maxVowels("leetcode", 3))
    # your test code here